<template>
  <table>
    <tr
      v-for="(row, rowIndex) in rows"
      :key="rowIndex"
    >
      <td
        v-for="(cell, cellIndex) in row"
        :key="cellIndex"
        :class="{ 'selected': isSelected(rowIndex, cellIndex) }"
        @click="selectCell(rowIndex, cellIndex)"
      >
        {{ cell }}
      </td>
    </tr>
  </table>
</template>
 
<script>
export default {
  data() {
    return {
      rows: [
        ['Cell 1', 'Cell 2', 'Cell 3'],
        ['Cell 4', 'Cell 5', 'Cell 6'],
        // ...
      ],
      selected: {
        row: null,
        column: null
      }
    };
  },
  methods: {
    isSelected(rowIndex, columnIndex) {
      return this.selected.row === rowIndex && this.selected.column === columnIndex;
    },
    selectCell(rowIndex, columnIndex) {
      this.selected = { row: rowIndex, column: columnIndex };
    }
  }
};
</script>
 
<style>
.selected {
  background-color: yellow;
}
</style>